package com.xy.novelweb.utils;

import java.util.Calendar;

public class TimeUtil {
		private static Calendar calendar = Calendar.getInstance();
		/*cal.get（Calendar.YEAR）；//年
		cal.get（Calendar.MONTH） + 1;//月（必须要+1）
		cal.get（Calendar.DATE）；//日
		cal.get（Calendar.HOUR_OF_DAY）；//时
		cal.get（Calendar.MINUTE）；//分
		cal.get（Calendar.SECOND）；//秒
		cal.get（Calendar.DAY_OF_WEEK）；
		*/
		public static int getYear(){
				return calendar.get(Calendar.YEAR);
		}
		public static int getMonth(){
				return calendar.get(Calendar.MONTH)+1;
		}
		public static int getDay(){
				return calendar.get(Calendar.DATE);
		}
		public static int getHour(){
				return calendar.get(Calendar.HOUR_OF_DAY);
		}
		public static int getMinute(){
				return calendar.get(Calendar.MINUTE);
		}
		public static  int getSecond(){
				return calendar.get(Calendar.SECOND);
		}
		public static int getWeekDay(){
				return calendar.get(Calendar.DAY_OF_WEEK);
		}
}